<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="description" content="">
    <meta name="author" content="">
    <title>登录页面</title>	
    <!-- Bootstrap Core CSS -->
    <link rel="stylesheet" href="/index/css/bootstrap.min.css"  type="text/css">
	<!-- Custom CSS -->
    <link rel="stylesheet" href="/index/css/style.css">
	<link rel="stylesheet" href="/index/css/org.css">
	<!-- Custom Fonts -->
    <link rel="stylesheet" href="/index/font-awesome/css/font-awesome.min.css"  type="text/css">
    <link rel="stylesheet" href="/index/fonts/font-slider.css" type="text/css">
	<!-- jQuery and Modernizr-->
	<script src="/index/js/jquery-2.1.1.js"></script>
	<script type="text/javascript" src="index/jQuery-1.11.3.min.js"></script>
	<!-- Core JavaScript Files -->  	 
    <script src="/index/js/bootstrap.min.js"></script>     
</head>
<body>
	<!--头部登录注册使用layout.html模板布局-->
	<!--登录界面-->
	<div id="page-content" class="single-page2">
		<div class="container">
			<div class="row">
				<div class="col-md-61">
					<div class="heading" style="font-size:28px;">用户登录</div>
					<form name="form1" id="ff1" method="post" action="loginCheck">
						<div class="form-group">
							<input type="text" class="form-control" placeholder="请输入用户名" name="username" id="username" required>
							<span class="form-ajax" ></span>
						</div>
						<div class="form-group">
							<input type="password" class="form-control" placeholder="密码" name="password" id="password" required>
							<span class="form-ajax" ></span>
						</div>
						<div class="form-group">
							<input type="yzm" class="form-control" placeholder="验证码" name="yzm" id="email"> 
							<span class="form-ajax" ></span>
						</div>
						<div class="form-group">
							<img id="yzm" src="{:captcha_src()}">
						</div>

						<button type="submit" class="btn btn-2"  id="show">立即登录</button>

						<a href="#" style="font-size: 14px;">忘记密码?</a>
					</form>
				</div>
			</div>
		</div>
	</div>
	<!-- 尾部适用layout.html模板布局 -->
</body>
</html>
<script type="text/javascript">
	var show = document.getElementById('show');
	show.onmouseover = function () {
	show.style.background = 'green';
};
show.onmouseout = function () {
	show.style.background = '#989CA2';
};
// 刷新验证码
var yzm = document.getElementById('yzm');
yzm.onclick = function()
{
	yzm.src = '{:captcha_src()}';
} 
</script>
<!-- AJAX登陆检测 -->
<script type="text/javascript">
// 用户名检测
$(function(){
	$(":input[name='username']").keyup(function(){
		var val = $(this).val();
		if (val != "") {
			$.get("loginNameAjax",{'username':val},function(data){
				$(".form-ajax:eq(0)").text(data);
			});
		}
	})
	// 密码检测
		$(":input[name='password']").keyup(function(){
			var val = $(this).val();
			var name = $(":input[name='username']").val();
			if (val != "" && name != "") {
				$.get("loginPwdAjax",{'pwd':val,'name':name},function(data){
					$(".form-ajax:eq(1)").text(data);
				});
			}
		});
});
</script>